Skip to content

Add unit tests for check_swapped_emails#3777

Open
Inengs wants to merge 2 commits intoaugurlabs:mainfrom
Inengs:unit-tests/check-swapped-emails
Open

Add unit tests for check_swapped_emails#3777
Inengs wants to merge 2 commits intoaugurlabs:mainfrom
Inengs:unit-tests/check-swapped-emails

Conversation

@Inengs
Copy link
Copy Markdown

@Inengs Inengs commented Mar 17, 2026

Description

  • Added unit tests for the check_swapped_emails function in analyzecommit.py

Tests cover:

  • Normal input where name and email are already correct
  • Swapped input where name and email are corrected
  • Edge case where both fields are empty strings
  • Mixed strings where a name and email are combined in the same field

This PR fixes #3741

I think the function needs to be made more robust, because it cant distinguish between a real email and a mixed string containing both name and email.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

@Inengs Inengs requested a review from MoralCode as a code owner March 17, 2026 23:49
@MoralCode
Copy link
Copy Markdown
Collaborator

Can you include a test for what happens if theres multiple @ signs in an email address?

found this case in the wild in https://github.com/chaoss/augur commit 36aab5b

@Inengs
Copy link
Copy Markdown
Author

Inengs commented Mar 25, 2026

Alright I'll do that, thank you

@Inengs
Copy link
Copy Markdown
Author

Inengs commented Mar 30, 2026

I have made the change

I am open to making any more changes, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unit test the check_swapped_emails function

2 participants